package com.quantdo.qtm.mysql.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import com.quantdo.qtm.interfaces.mysql.pojo.monitor.query.MysqlStatusPointQuery;
import com.quantdo.qtm.mysql.pojo.model.MysqlStatusPointDo;

@Mapper
public interface MysqlStatusPointDao {

    /**
     * 条件查询
     * @param statusPointQuery
     * @return
     */
    public List<MysqlStatusPointDo> selectConditionStatus(MysqlStatusPointQuery statusPointQuery);

    /**
     * 插入
     * @param pointDo
     * @return
     */
    @Insert("insert into mysql_status_point(curr_time, interval_second, qps, tps, select_qty, insert_qty, update_qty, delete_qty, write_qty"
            + ",threads_connected,threads_running,slow_queries,bytes_sent,bytes_received"
            + ",innodb_buffer_pool_used_rate,key_blocks_used_rate) "
            + "values(#{currTime}, #{intervalSecond}, #{qps}, #{tps},#{selectQty},#{insertQty},#{updateQty},#{deleteQty},#{writeQty}"
            + ",#{threadsConnected},#{threadsRunning},#{slowQueries},#{bytesSent},#{bytesReceived}"
            + ",#{innodbBufferPoolUsedRate},#{keyBlocksUsedRate})")
    public int insert(MysqlStatusPointDo pointDo);

}
